package com.yang.SpringTest.annotation.scheduledLearn;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * <p>Scheduled注解测试</p>
 *
 * @author By: chengxuyuanshitang <br>
 * @Package: com.yang.SpringTest.annotation.scheduledLearn <br>
 * @CreateTime: 2025-02-06 09:26 <br>
 */
@Slf4j
public class ScheduledDemoTest {


    public static void main(String[] args) {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(ScheduledDemoConfig.class);
        log.info("**************** IOC容器启动完成....");
        // 保持容器运行一段时间，观察定时任务的执行
        try {
            // 保持200秒
            Thread.sleep(200 * 1000);
        } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
        }

        context.close();
        log.info("**************** IOC容器关闭....");
    }

}